/*
 * TITLE:DebuggerSplash
 * AUTHOR:Manori Thakur
 * PURPOSE: Displays the splash screen to player
 */
package com.example.android.debuggermenu;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.TextView;

public class DebuggerSplash extends DebuggerActivity {
	private static final String TAG = DebuggerSplash.class.getSimpleName();
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_layout);
        startAnimating();
    }

    /**
     * Helper method to start the animation on the splash screen
     */
    private void startAnimating() {
        // Fade in top title
        TextView logo1 = (TextView) findViewById(R.id.TextViewTopTitle);
        Animation fade1 = AnimationUtils.loadAnimation(this, R.anim.fade_in);
        //logo1.startAnimation(fade1);
        
        Animation fade2 = AnimationUtils.loadAnimation(this, R.anim.fade_in2);
        //logo1.startAnimation(fade2);
        // Transition to Main Menu when bottom title finishes animating
        startActivity(new Intent(DebuggerSplash.this, DebuggerMenu.class));
    
        /*
        fade2.setAnimationListener(new AnimationListener() {
            public void onAnimationEnd(Animation animation) {
                // The animation has ended, transition to the Main Menu screen
                startActivity(new Intent(DebuggerSplash.this, DebuggerMenu.class));
                DebuggerSplash.this.finish();
            }
            

            public void onAnimationRepeat(Animation animation) {
            }

            public void onAnimationStart(Animation animation) {
            }
        });
        */
    }


    @Override
    protected void onPause() {
        super.onPause();
        // Stop the animation
        TextView logo1 = (TextView) findViewById(R.id.TextViewTopTitle);
        //logo1.clearAnimation();
    }

    @Override
    protected void onResume() {
        super.onResume();

        // Start animating at the beginning so we get the full splash screen experience
        startAnimating();
    }
}

